package Game;

import java.util.ArrayList;

public class Stack 
{
	private ArrayList<Card> stack;
	
	public Stack()
	{
		stack = new ArrayList<Card>();
	}
	
	public void addCard(Card a)
	{
		stack.add(a);
	}
	
	public ArrayList<Card> clear()
	{
		ArrayList<Card> stacky = stack;
		stack = new ArrayList<Card>();
		return stacky;
	}
	
	public int getSize()
	{
		return stack.size();
	}
	
	public Card getTopCard()
	{
		return stack.get(0);
	}
	
	
	public String toString()
	{
		String r = "";
		if(stack.size() == 0)
		{
			r = "no card";
			return r;
		}
		else
		{
			r = stack.get(0).toString();
		}
		
		return r;
	}
	
	
}
